<?php 
//短信验证使用测试版本 正式上线时需要改动
//短信验证
function send_sms_code($phone,$code){
	//请求地址
	$serverIP='app.cloopen.com';
	//请求端口
	$serverPort='8883';
	//REST版本号
	$softVersion='2013-12-26';
	//主账号
	$accountSid=C('RONGLIAN_ACCOUNT_SID');
	//主账号Token
	$accountToken=C('RONGLIAN_ACCOUNT_TOKEN');
	//应用ID
	$appId=C('RONGLIAN_APPID');
	$rest = new \Org\Xb\Rest($serverIP,$serverPort,$softVersion);
	$rest->setAccount($accountSid,$accountToken);
	$rest->setAppId($appId);
	//发送模板短信
	$result = $rest->sendTemplateSMS($phone,array($code,5),1);
	if($result==NULL){
		return false;
	}
	if($result->statusCode!=0){
		return false;
	}else{
		return true;
	}
}